package com.example.main

import android.webkit.JsPromptResult
import com.blankj.utilcode.util.LogUtils
import com.tencent.smtt.export.external.interfaces.ConsoleMessage
import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.WebChromeClient
import com.tencent.smtt.sdk.WebView

class X5WebViewChromeClient:WebChromeClient() {

    override fun onJsAlert(p0: WebView?, p1: String?, p2: String?, p3: JsResult?): Boolean {
        return true
    }

    override fun onJsConfirm(p0: WebView?, p1: String?, p2: String?, p3: JsResult?): Boolean {
        return true
    }

    override fun onJsPrompt(p0: WebView?, p1: String?, p2: String?, p3: String?, p4: com.tencent.smtt.export.external.interfaces.JsPromptResult?): Boolean {
        return true
    }

    override fun onJsBeforeUnload(p0: WebView?, p1: String?, p2: String?, p3: JsResult?): Boolean {
        return true
    }

    override fun onConsoleMessage(msg: ConsoleMessage?): Boolean {
        LogUtils.i("X5WebView: ${msg?.message()}")
        return true
    }







}